package com.joysuch.wwyt.edu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joysuch.wwyt.edu.bean.EduTrainningRecordListBean;
import com.joysuch.wwyt.edu.bean.dto.TrainningRelevanceDto;
import com.joysuch.wwyt.edu.bean.vo.*;
import com.joysuch.wwyt.edu.entity.EduExam;
import com.joysuch.wwyt.edu.entity.EduTrainningRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
@Mapper
public interface EduTrainningRecordMapper extends BaseMapper<EduTrainningRecord> {

    EduTrainningRecord selectRecordsByDepartId(Long departId);

    /**
     * 查询培训关联考试关联课程关系
     * @return
     */
    List<TrainningRelevanceDto> selectTrainningRelevance();

    int deleteExamUser(@Param("examId") Long examId);

    int updateExamTime(@Param("trainningDate") Date trainningDate,
                       @Param("trainningEndDate") Date trainningEndDate,
                       @Param("examId") Long examId);

    Page<EduTrainningRecordVo> trainningRecordList(Page<EduTrainningRecord> eduTrainningRecordPage,
                                                   @Param("condition") EduTrainningRecordListBean.SearchEduTrainningRecord condition);

    Page<EduTrainningRecordVo> trainingStatistics(Page<EduTrainningRecord> page,
                                                  @Param("condition") EduTrainningRecordListBean.SearchEduTrainningRecord condition);

    List<EduTrainningRecord>  selectByExamId(@Param("id") Long id);

    Page<MyTrainingAppVo> myTrainingList(Page<EduTrainningRecord> eduTrainningRecordPage,
                                         @Param("condition") EduTrainningRecordListBean.SearchEduTrainningRecord condition);

    List<Long> selectCoursewareByTrainingId(@Param("id") Long id);

    TrainingAppDetailsVo selectDetailsByTrainingId(@Param("trainingId") Long trainingId);

    int selectTrainingByName(@Param("trainingName") String trainingName);

    Long selectExamIdByTrainingId(@Param("id") Long id);

    List<EduTrainningRecord> selectEndTraining();

    int selectSole();

    EduTrainningRecord selectByIdUnFinished(@Param("trainingId") Long trainingId);

    List<EduTrainningRecord> selectByExamIdUnFinish(@Param("examId") Long examId);

}
